#include <iostream>
int main() 
{ 
    int v[3] = {3, 2, 3};
    int f[4][9] = {0};
    f[0][0] = 1;
    for(int i = 1; i <= 3; i++) 
        for(int j = 0; j <= 8; j++) //当前总共要选出j个 
            for(int k = 0; k <= j; k++) //已经选了k个
                if(j - k <= v[i-1]) //此时要选j-k个
                    f[i][j] += f[i - 1][k];
    for (size_t i = 0; i <= 3; i++)
    {
        std::cout<<"id: "<<i<<"  ";
        for (size_t j = 0; j <= 8; j++)
        {
            std::cout<<f[i][j]<<"  ";
        }
        std::cout<<std::endl;
    }
} 